/* GUI CONVERTED from rciq03d.p (converter v1.75) Tue Apr 10 12:04:31 2001 */
/* rciq03d.p - Release Management Customer Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.6.1.3 $                                                        */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.5    LAST MODIFIED: 07/07/95           BY: GWM *J049*          */
/* REVISION: 8.6    LAST MODIFIED: 04/02/97   BY: *K09H* Vinay Nayak-Sujir    */
/* REVISION: 8.6    LAST MODIFIED: 10/22/97   BY: *K14X* CK Mohan             */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane            */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan           */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown           */
/* $Revision: 1.6.1.3 $    BY: Jean Miller    DATE: 03/22/01 ECO: *P008*       */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* CONTAINER INQUIRY */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rciq03d_p_1 "ID"
/* MaxLen: Comment: */

&SCOPED-DEFINE rciq03d_p_2 "Container"
/* MaxLen: Comment: */

&SCOPED-DEFINE rciq03d_p_3 "Site"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable ctype       as character initial "c" no-undo.
define variable disp_abs_id as character no-undo.

define variable indent_id   as character format "x(12)" label {&rciq03d_p_1}
                            no-undo.

define shared variable global_recid as recid.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
abs_shipfrom     colon 28 label {&rciq03d_p_3}
   si_desc          at 45    no-label
   abs_id           colon 28 label {&rciq03d_p_2}
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

find abs_mstr where recid(abs_mstr) = global_recid no-lock no-error.

if available abs_mstr and
   abs_id begins ctype and
   abs_type begins "S"
then do:

   find si_mstr where si_site = abs_shipfrom no-lock no-error.

   display
      abs_shipfrom
      si_desc when (available si_mstr)
      substring(abs_id,2,8) @ abs_id
   with frame a.

end.

{wbrp01.i}

repeat:

   do with frame a:

      if c-application-mode <> "WEB" then
         prompt-for abs_shipfrom abs_id
      editing:

         global_site = input abs_shipfrom.

         if frame-field = "abs_shipfrom" then do:
            {mfnp05.i abs_mstr abs_id
               "abs_id begins ctype"
               abs_shipfrom
               "input abs_shipfrom"}

            if recno <> ? then do:
               find si_mstr where si_site = abs_shipfrom
                  no-lock no-error.

               disp_abs_id = substring(abs_id,2,8).

               display
                  abs_shipfrom
                  si_desc          when (available si_mstr)
                  ""               when (not available si_mstr) @ si_desc
                  disp_abs_id @ abs_id.
            end.
         end.
         else
            if frame-field = "abs_id" then do:
            {mfnp05.i abs_mstr abs_id
               "abs_shipfrom = input abs_shipfrom
             and abs_id begins ctype"
               abs_id
               "ctype + input abs_id"}
            if recno <> ? then do:
               find si_mstr where si_site = abs_shipfrom
                  no-lock no-error.

               disp_abs_id = substring(abs_id,2,8).

               display
                  abs_shipfrom
                  si_desc          when (available si_mstr)
                  ""               when (not available si_mstr) @ si_desc
                  disp_abs_id @ abs_id.
            end.
         end.
         else do:
            status input.
            readkey.
            apply lastkey.
         end.
      end.

      {wbrp06.i &command = prompt-for &fields = "  abs_shipfrom abs_id" &frm="a"}

   end.

   if (c-application-mode <> "WEB") or
      (c-application-mode = "WEB" and
      (c-web-request begins "DATA"))
   then do:

      find abs_mstr where
           abs_shipfrom = input abs_shipfrom
       and abs_id = ctype + input abs_id
       and abs_type = "S"
      no-lock no-error.

      if not available abs_mstr then do:
         /* CONTAINER NUMBER DOES NOT EXIST */
         {pxmsg.i &MSGNUM=763 &ERRORLEVEL=3}
         if c-application-mode = "WEB" then return.
         undo, retry.
      end.

      find si_mstr where si_site = abs_shipfrom no-lock no-error.

   end.

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "terminal" &printWidth = 80
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "no"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   disp_abs_id = substring(abs_id,2,8).

   display
      abs_shipfrom
      si_desc when (available si_mstr)
      disp_abs_id @ abs_id
   with frame a.

   put skip(1).

   {gprun.i ""rciq03d2.p"" "(input recid(abs_mstr), input 0)"}

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


   {pxmsg.i &MSGNUM=8 &ERRORLEVEL=1}

   if abs_par_id > "" then do:
      /* This is subordinate to # */
      {pxmsg.i &MSGNUM=8102 &ERRORLEVEL=1 &MSGARG1=caps(abs_par_id)}
   end.

   global_recid = recid(abs_mstr).

end.

{wbrp04.i &frame-spec = a}
